#!/bin/bash

function info() {
echo Usage: `basename $0` 'list'
exit 1
}

while getopts  ":p:f:" opt; do
	case  $opt  in
		p) out_prefix=$OPTARG;;
		f) suffix=$OPTARG;;
		*) info;;
	esac
done
shift $(($OPTIND - 1))


if [ $# -lt 1 ]; then info; fi

. $var


cd ~/sg-users/yangfei/data/meth/gse
# for i in GSE73518 GSE34387 GSE90709 GSE86961 GSE89852 GSE73801; do

    # cd $i
        # for j in 200 400; do
            # for k in 5k 1w; do
                # for l in `seq 2 5`; do
                    # echo $i $k $j $l
                    # feature_merge_test.py -p1.$k.$j.$l $i.Rd.$l.txt $data/meth/450.clean.b37.bed.cluster.id_change_$j
                    
                    # rf_methy.py 1.$k.$j.feature_merge.train.450.clean.b37.bed.cluster.id_change_$j.txt 1.$k.$j.$l.feature_merge.test.450.clean.b37.bed.cluster.id_change_$j.txt
                # done
            # done
        # done
    # cd -
# done

stat=~/sg-users/yangfei/data/meth/gse/feature_merge.stat
:>$stat
# for i in GSE73518 GSE34387 GSE90709 GSE86961 GSE89852 GSE73801; do

    # cd $i
        # echo $i >>$stat
        # grep feature_merge predict_rf.1|cut -f2|sort|uniq -c|sed 's/^  *//'|sed 's/ /\t/'|sort -k1,1nr >>$stat
    # cd -
# done

# for i in GSE73518 GSE34387 GSE90709 GSE86961 GSE89852 GSE73801; do

    # cd $i
        # echo $i >>$stat
        # for j in `seq 5`; do
            # grep -F "$i.Rd.$j.txt" predict_rf.1|cut -f2,7 >>$stat
        # done
        
    # cd -
# done

for i in `seq 22` X Y; do
    
    getw.sh https://ftp-trace.ncbi.nih.gov/1000genomes/ftp/release/20130502/ALL.chr$i.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz.tbi
    
    getw.sh https://ftp-trace.ncbi.nih.gov/1000genomes/ftp/release/20130502/ALL.chr$i.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz
    
done


. $cmd_done
